#! /bin/sh
DAEMON=/usr/sbin/nvargus-daemon
DESC=nvargus-daemon
test -x $DAEMON || exit 0

case "$1" in
  start)
      echo -n "Starting $DESC: "
      $DAEMON < /dev/null > /dev/null 2>&1 &
      echo "[OK]"
      ;;
  stop)
      echo -n "Stopping $DESC: "
      killall $DESC 2>/dev/null
      echo "[OK]"
      ;;
  restart)
      echo -n "Restarting $DESC: "
      killall $DESC 2>/dev/null
      $DAEMON < /dev/null > /dev/null 2>&1 &
      echo "[OK]"
      ;;
  *)
      N=/etc/init.d/nvargus-daemon
      echo "Usage: $N {start|stop|restart}" >&2
      exit 1
      ;;
esac

exit 0
